package com.lock.lock_common.api.region;

import com.lock.lock_common.dto.Result;
import com.lock.lock_common.pojo.RegionAddress;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface RegionAddressApi {
    /**
     * 新增地址
     * @param regionAddress
     * @return
     */
    @RequestMapping("/addAddress")
    Integer addAddress(@RequestBody RegionAddress regionAddress);

    /**
     * 删除地址
     * @param addressId
     * @return
     */
    @RequestMapping("/delAddress")
    Integer delAddress(@RequestParam Integer addressId);

    /**
     * 根据用户Id查询用户地址
     * @param userId
     * @return
     */
    @RequestMapping("/selectAddressByUserId")
    List<RegionAddress> selectAddressByUserId(@RequestParam Integer userId);

    /**
     * 根据地址id查询地址
     * @param addressId
     * @return
     */
    @RequestMapping("/selectAddressByAddressId")
    RegionAddress selectAddressByAddressId(@RequestParam Integer addressId);

    /**
     * 修改地址
     * @param regionAddress
     * @return
     */
    @RequestMapping("/updAddress")
    Integer  updAddress(@RequestBody RegionAddress regionAddress);

    /**
     * 修改为默认地址
     * @param addressId
     * @return
     */
    @RequestMapping("/updStatus")
    Integer updStatus(@RequestParam Integer addressId,@RequestParam Integer userId);

    /**
     * 测试用例
     * @return
     */
    @RequestMapping("/selectAllAddress")
    List<RegionAddress> selectAllAddress();
}
